<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            border: 1px solid red;
        }
        .father{
            display: flex;
            /* 主轴水平居中 */
            justify-content: center;
            /* 侧轴垂直居中 */
            align-items: center;
            height: 500px;
    
        }
        .div1{
             /* flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ] */
            flex:1 1 auto;
        }
        .div2{
            flex:2 2 auto;
            align-self:flex-end;
        }
        .div3{
            flex:1 1 auto;

        }
        .father .item{
            width: 100px;
            height: 100px;
        }
       
/* 垂直居中的定位写法，注意，父元素需要有定位属性才生效
        .father .item{
            width: 100px;
            height: 100px;
            position: absolute;
            top:50%;
            transform: translateY(-50%);
        } */
    </style>
</head>
<body>
    <div class="father">
        <div class="item div1">div1</div>
        <div class="item div2">div2</div>
        <div class="item div3">div3</div>
    </div>
</body>
</html>